if InstalledCmp() && InstalledNvimLsp()
    source $CFG_PATH/cmp.vim
    luafile $LUA_PATH/cmp.lua
    luafile $LUA_PATH/lsp.lua
elseif InstalledCoc()
    source $CFG_PATH/coc.vim
elseif g:complete_engine == 'apm'
    source $CFG_PATH/apm.vim
elseif g:complete_engine != ''
    let g:complete_engine = 'mcm'
    source $CFG_PATH/mcm.vim
endif
" --------------------------
" dict
" --------------------------
PlugAddOpt 'vim-dict'
" ------------------------------
" pairs
" ------------------------------
if Installed('pear-tree')
    let g:pear_tree_map_special_keys = 0
endif
" ------------------------------
" vsnip
" ------------------------------
if Installed('vim-vsnip')
    let g:vsnip_snippet_dir = expand("~/.leovim/snippets")
    nnoremap <M-h>s :VsnipOpen<Space>
    nnoremap <M-h>S :tabe ~/.leovim/snippets
endif
if Installed('vim-vsnip', 'vim-vsnip-integ')
    smap <expr><C-f> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<C-o>A'
    smap <expr><C-b> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : '<C-o>I'
    imap <expr><C-f> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-o>A'
    imap <expr><C-b> vsnip#available(-1) ? '<Plug>(vsnip-jump-prev)' : '<C-o>I'
elseif Installed('luasnip')
    smap <silent><C-f> <cmd>lua require('luasnip').jump(1)<Cr>
    smap <silent><C-b> <cmd>lua require('luasnip').jump(-1)<Cr>
    imap <silent><expr><C-f> luasnip#jumpable(1) ? '<Plug>luasnip-jump-next' : '<C-o>A'
    imap <silent><expr><C-b> luasnip#jumpable(-1) ? '<Plug>luasnip-jump-prev' : '<C-o>I'
endif
" -----------------------
" fzf snippet
" -----------------------
if InstalledFzf()
    imap <c-x><c-l> <plug>(fzf-complete-line)
    imap <c-x><c-f> <plug>(fzf-complete-path)
endif
